Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[grafana] feat(grafana): Introduce profiling container port #3472

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

simonswine
Copy link
Contributor

@simonswine simonswine commented Dec 10, 2024

In order to enable profiling using Grafana Alloy and Grafana Pyroscope
currently you would need to abuse another container port or insert a
dummy container to facitilitate profile collection.

This is because a containerPort is matched with the annotations to
enable profiling. As a workaround I am "abusing" the port :9094, as for
the example I am working on it is unused. This change will make it
possible to coexist with gossip-tcp and you would be able to enable
profiling like this:

helm upgrade -n pyroscope-test --install grafana grafana/grafana \
  --set env.GF_DIAGNOSTICS_PROFILING_ENABLED=true \
  --set env.GF_DIAGNOSTICS_PROFILING_ADDR=0.0.0.0 \
  --set env.GF_DIAGNOSTICS_PROFILING_PORT=6060 \
  --set-string 'podAnnotations.profiles\.grafana\.com/cpu\.scrape=true' \
  --set-string 'podAnnotations.profiles\.grafana\.com/cpu\.port=6060' \
  --set-string 'podAnnotations.profiles\.grafana\.com/memory\.scrape=true' \
  --set-string 'podAnnotations.profiles\.grafana\.com/memory\.port=6060' \
  --set-string 'podAnnotations.profiles\.grafana\.com/goroutine\.scrape=true' \
  --set-string 'podAnnotations.profiles\.grafana\.com/goroutine\.port=6060'

This is related to grafana/pyroscope#3753

@simonswine simonswine force-pushed the 20241210_improve-profiling-of-grafana branch from 87c4293 to ee8a108 Compare December 10, 2024 13:55
In order to enable profiling using Grafana Alloy and Grafana Pyroscope
currently you would need to abuse another container port or insert a
dummy container to facitilitate profile collection.

This is because a containerPort is matched with the annotations to
enable profiling. As a workaround I am "abusing" the port :9094, as for
the example I am working on it is unused. This change will make it
possible to coexist with gossip-tcp and you would be able to enable
profiling like this:

```
helm upgrade -n pyroscope-test --install grafana grafana/grafana \
  --set env.GF_DIAGNOSTICS_PROFILING_ENABLED=true \
  --set env.GF_DIAGNOSTICS_PROFILING_ADDR=0.0.0.0 \
  --set env.GF_DIAGNOSTICS_PROFILING_PORT=6060 \
  --set-string 'podAnnotations.profiles\.grafana\.com/cpu\.scrape=true' \
  --set-string 'podAnnotations.profiles\.grafana\.com/cpu\.port=6060' \
  --set-string 'podAnnotations.profiles\.grafana\.com/memory\.scrape=true' \
  --set-string 'podAnnotations.profiles\.grafana\.com/memory\.port=6060' \
  --set-string 'podAnnotations.profiles\.grafana\.com/goroutine\.scrape=true' \
  --set-string 'podAnnotations.profiles\.grafana\.com/goroutine\.port=6060'
```

This is realted to grafana/pyroscope#3753

Signed-off-by: Christian Simon <[email protected]>
@simonswine simonswine force-pushed the 20241210_improve-profiling-of-grafana branch from ee8a108 to 16d47d1 Compare December 10, 2024 13:56
@simonswine simonswine changed the title feat(grafana): Introduce profiling container port [grafana] feat(grafana): Introduce profiling container port Dec 10, 2024
@simonswine simonswine marked this pull request as ready for review December 10, 2024 14:22
Copy link
Collaborator

@jkroepke jkroepke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants